package com.pojo;

import java.math.BigDecimal;
import java.sql.Timestamp;

public class Record {
    private String id;
    private String user_id;
    private String car_id;
    private Timestamp rentTime;
    private Timestamp backTime;
    private BigDecimal price;

    public Record() {
    }

    public Record(String id, String user_id, String car_id) {
        this.id = id;
        this.user_id = user_id;
        this.car_id = car_id;
    }

    public Record(String id, String user_id, String car_id, Timestamp rentTime, Timestamp backTime, BigDecimal price) {
        this.id = id;
        this.user_id = user_id;
        this.car_id = car_id;
        this.rentTime = rentTime;
        this.backTime = backTime;
        this.price = price;
    }

    @Override
    public String toString() {
        if (backTime == null) {
            return id + "\t" + user_id + "\t" + car_id + "\t" + rentTime + "\t" + "未归还" + "\t" + "未归还无价格";
        } else {
            return id + "\t" + user_id + "\t" + car_id + "\t" + rentTime + "\t" + backTime + "\t" + price;
        }

    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUser_id() {
        return user_id;
    }

    public void setUser_id(String user_id) {
        this.user_id = user_id;
    }

    public String getCar_id() {
        return car_id;
    }

    public void setCar_id(String car_id) {
        this.car_id = car_id;
    }

    public Timestamp getRentTime() {
        return rentTime;
    }

    public void setRentTime(Timestamp rentTime) {
        this.rentTime = rentTime;
    }

    public Timestamp getBackTime() {
        return backTime;
    }

    public void setBackTime(Timestamp backTime) {
        this.backTime = backTime;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }
}
